; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs < %s \
; RUN:   -target-abi=ilp32d | FileCheck %s
; RUN: llc -mtriple=riscv64 -mattr=+d -verify-machineinstrs < %s \
; RUN:   -target-abi=lp64d | FileCheck %s

define double @double_imm() nounwind {
; CHECK-LABEL: double_imm:
; CHECK:       # %bb.0:
; CHECK-NEXT:    lui a0, %hi(.LCPI0_0)
; CHECK-NEXT:    fld fa0, %lo(.LCPI0_0)(a0)
; CHECK-NEXT:    ret
  ret double 3.1415926535897931159979634685441851615905761718750
}

define double @double_imm_op(double %a) nounwind {
; CHECK-LABEL: double_imm_op:
; CHECK:       # %bb.0:
; CHECK-NEXT:    lui a0, %hi(.LCPI1_0)
; CHECK-NEXT:    fld fa5, %lo(.LCPI1_0)(a0)
; CHECK-NEXT:    fadd.d fa0, fa0, fa5
; CHECK-NEXT:    ret
  %1 = fadd double %a, 1.0
  ret double %1
}
